<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<p:panel style="border: none;" id="popcPaisPanel">
	<h:panelGrid columns="4" cellpadding="2" style="border: 2px;">
		<h:outputText value="Código" />
		<h:outputText value="Pais" />
		<h:outputText value="DDI" />
		<h:outputText value="" />

		<p:inputText id="popcPaisIdFiltro" value="#{beanPais.filtro.id}"
			maxlength="4" size="7" />
		<p:inputText id="popcPaisPaisFiltro" value="#{beanPais.filtro.pais}"
			size="78" />
		<p:inputText id="popcPaisDdiFiltro" value="#{beanPais.filtro.ddi}"
			size="7" />
		<p:commandButton id="popcPaisFind" value="Buscar"
			icon="ui-icon-search" action="#{beanPais.find}"
			update="popcPaisTabelaPais" />
	</h:panelGrid>

	<br></br>
	<p:separator />

	<p:dataTable value="#{beanPais.paises}" var="pais"
		id="popcPaisTabelaPais">
		<p:column headerText="Codigo" width="40">
			<h:outputText value="#{pais.id}" />
		</p:column>

		<p:column headerText="Pais">
			<h:outputText value="#{pais.pais}" />
		</p:column>

		<p:column headerText="DDI" width="40">
			<h:outputText value="#{pais.ddi}" />
		</p:column>

		<p:column headerText="Sigla" width="40">
			<h:outputText value="#{pais.sigla}" />
		</p:column>

		<p:column headerText="Selecionar" width="10">
			<p:commandButton id="popcPaisSelectPais"
				oncomplete="dConsultaPais.hide()" icon="ui-icon-circle-check"
				title="selecionar" update=":form:pmEstadoPanel">
				<f:setPropertyActionListener value="#{pais}"
					target="#{beanEstado.estado.pais}" />
			</p:commandButton>
		</p:column>
	</p:dataTable>

	<p:separator />
	<br></br>

	<h:panelGrid columns="2">
		<p:commandButton id="popcPaisNovo" value="Novo" title="Criar Pais"
			onclick="dManterPais.show() ">
		</p:commandButton>
	</h:panelGrid>
</p:panel>

<p:dialog header="Manter Pais" widgetVar="dManterPais"
	id="popcPaisDManterPais" resizable="false">
	<ui:include src="/pais/pManterPais.xhtml"></ui:include>
</p:dialog>

</html>